import 'dart:async';

import 'package:flutter/material.dart';
import 'package:haokezufang/scoped_model/auth_login.dart';
import 'package:haokezufang/utils/scoped_model_helper.dart';


class SplashPage extends StatefulWidget {
  const SplashPage({super.key});

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    Timer(const Duration(seconds: 1), () {
      Navigator.of(context).pop();
    });
    Timer(Duration.zero, () {
      ScopedModelHelper.getModel<AuthLoginModel>(context).initApp(context);
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
          image: DecorationImage(
              fit: BoxFit.fill,
              image: AssetImage('static/images/loading.jpg'))),
    );
  }
}
